<template>
  <div class="container">
    <div class="header"><h>hhh</h> </div>
    <div class="body">
      <div class="nar">
      </div>
      <div class="content">
        <a @click="click" >dsfsdfsdf</a>
        <button @click="add">+1</button>
        <button @click="reset">reset</button>
        <a v-html="data"></a>
        <i class="el-icon-caret-top"></i>
        <i class="el-icon-caret-bottom" style="color: #800000"/>
      </div>
    </div>
    <div class="footer"><h>hhh</h> </div>
  </div>

</template>

<script>

import axios from "axios";

// "<link>一种基于动物自治体的寻优模式:鱼群算法</link>"

export default {
  name: "Test",
  data() {
    return {
      count: 0,
      tableData: [],
      tmp: {},
      data: "<h2>你好vue,大雄测试</h2>"
    }
  },
  created() {
    let str = 'hello   ad   asdsda d'
    let str2 = 'hello d'
    let list = str2.split(/ +/)
    console.log(list);
    console.log(str.search(list[1]))
    // if (sessionStorage.count)
    //   this.count = sessionStorage.count

    // this.tableData.push('a', 'b', 'c')
    // console.log(this.tableData)
    // let idx = this.tableData.indexOf('b')
    // if (idx !== -1)
    //   this.tableData.splice(idx, 1)
    // console.log(this.tableData)


    // let data = {"query":{"bool":{"must":[{"match_all":{}}],"must_not":[],"should":[]}},"from":0,"size":10,"sort":[],"aggs":{}}
    // axios.post("http://121.36.3.252:9200/paper_new/_search", data).then(res => {
    //   console.log(res);
    // }).catch(err => {
    //   console.log(err);
    // })

    // let item =
    // {
    //   select: 'title',               // 选择字段 doi, title, source, fields, author
    //   content: 'hhh',                 // 搜索内容
    //     relation: 'AND',            // 逻辑关系 AND OR NOT, 表示 必包含，可包含，必不包含
    //     kind: 0                     // 搜索精度 0: 模糊, 1:精确
    // }
    // let data = {}, result = {}
    // data[item.select] = item.content
    // if (kind == 0)
    //     result['match'] = data

  },
  methods: {
    click() {
      alert("ee")
    },
    add() {
      if (sessionStorage.count) {
        sessionStorage.count = Number(sessionStorage.count) + 1;
      }
      else
        sessionStorage.count = 1;
      this.count = sessionStorage.count;
    },
    reset() {
      sessionStorage.count = 0;
      this.count = sessionStorage.count;
    }
  }
}
</script>

<style scoped>

.content a:hover {
  color: red;
  cursor: pointer;
}
.container {
  display: flex;
  min-height: 100vh;
  flex-direction: column;
  background-color: #2c3e50;
}

.body {
  display: flex;
  flex: 1;
}

.header {
  flex: 1;
  background-color: blue;
}

.nar {
  flex: 0 0 12em;
  order: -1;
  display: flex;
  background-color: #42b983;

}

.content{
  flex:1;
  background-color: aqua;

}

.footer {
  flex: 1;
  background-color: red;

}
</style>